﻿@model Model.ViewModel.LoginUser


<div class="row">

    <div class="col-md-7 col-xs-0 col-sm-7">
        <h6></h6>
        <img src="~/Images/login.jpg" class="img-responsive" />
    </div>
    <div class="col-md-5 col-xs-12 col-sm-5">
        <div class="well well-lg bg-success" style="background-color:#f0f5fb; box-shadow: 0px 2px 8px 0px rgba(50,50,50,0.35); ">
            @using (Ajax.BeginForm("Login", "Admin/AdminLogin", new AjaxOptions
    {
        HttpMethod = "Post",
        OnSuccess = "Success",
        LoadingElementId = "Waiting"
    }, new { @class = "form-horizontal", role = "form" }))
            {

                <div class="form-group">
                    <label for="LoginName" class="col-sm-3 control-label">用户名：</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(u => u.LoginName, new { Value = "peter", @class = "form-control" })@Html.ValidationMessageFor(u => u.LoginName)
                    </div>
                </div>
                <div class="form-group">
                    <label for="Pwd" class="col-sm-3 control-label">密码：</label>
                    <div class="col-sm-9">

                        @Html.PasswordFor(u => u.Pwd, new { Value = "123456", @class = "form-control" })@Html.ValidationMessageFor(u => u.Pwd)
                    </div>
                </div>
                <div class="form-group">
                    <label for="RadioButto" class="col-sm-3 control-label">班次：</label>
                    <div class="col-sm-9">
                        @{

                foreach (var g in ViewData["Shift"] as List<Model.ViewModel.Shift>)
                {
                    <span class="radio-inline">

                        @Html.RadioButtonFor(u => u.shiftID, @g.ShfitID, new { @class = "", @ShfitID = g.ShfitID })@g.ShfitName
                    </span>
                }
                <span class="radio-inline text-danger">@Html.ValidationMessageFor(u => u.shiftID)</span>
                        }

                    </div>

                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-9">

                        <div class="checkbox">
                            <label>
                                @Html.CheckBoxFor(u => u.IsCookie) 保存密码
                            </label>
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-9">
                        <button type="submit" class="btn btn-default">登录</button><span id="Waiting">
                            <img src="~/Images/ajax-loader.gif" />
                        </span>
                    </div>
                </div>
            }
        </div>
    </div>
</div>




<script type="text/javascript">
    function Success(Jsonmsg) {
        $.procAjaxData(Jsonmsg, function () { window.location = Jsonmsg.BackUrl; });

    }

</script>